package com.s7.recycler.adapter;

import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.s7.recycler.holder.BaseViewHolder;

/**
 * RecyclerView 单样式适配器
 */
public abstract class BaseRecyclerAdapter<T> extends SRecyclerAdapter<T, BaseViewHolder> {

    /**
     * 获取子item
     * @return
     */
    protected abstract int getLayoutId();

    @NonNull
    @Override
    protected BaseViewHolder getViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = getView(parent, getLayoutId());
        return new BaseViewHolder(view);
    }
}
